I have been in this position. I was having an "intense emotional affair" with someone who was my friend from a work situation and also knew my wife at the time. This "affair" never moved to the physical level, but at the time that was not terribly relevant to my wife. Our marriage did not end over this, but it did point out that there were issues which were not being addressed by either of us, and 18 months later my own restlessness brought our marriage to an end.
I am now in a long term committed relationship and still have a friendship with my exwife. I believe we are constantly evolving and we don't always grow at the same rates. In my own case I was opperating under the illusion that I could overcome feelings I eventually could no longer deny.
Every individual and situation is different, so I guess you need to weigh all the possibilities you can imagine and determine how you would handle each of them and then make a plan of action.
30